package com.gymmsystem.GYMMSystem.service;

import com.gymmsystem.GYMMSystem.dto.CourseReservationDTO;
import com.gymmsystem.GYMMSystem.entity.Course;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;

public interface CourseService {

    List<Course> getAvailableCourses();

    List<Course> getCoursesByCoachId(Long coachId);

    Course getCourseById(Long courseId);

    boolean createCourse(Course course);

    boolean updateCourse(Course course);

    boolean deleteCourse(Long courseId);

    boolean incrementCourseCurrent(Long courseId);

    boolean decrementCourseCurrent(Long courseId);

    List<Course> getCoursesWithCoachInfo();

    boolean checkCoachAvailability(Long coachId, String courseTime);

    boolean checkCourseCapacity(Long courseId);

    // 获取课程图片URL
    String getCourseImageUrl(Long courseId);

    // 更新课程图片
    boolean updateCourseImage(Long courseId, String imageUrl);

    void autoUpdateReservationStatusByCourse(Long courseId);
    void batchAutoUpdateReservationStatus();

    // 分页查询课程列表（管理员使用）
    Map<String, Object> getCoursesByPage(Integer page, Integer size, Integer status, String search);

    // 获取所有课程（管理员使用）
    List<Map<String, Object>> getAllCourses();

    // 更新课程状态（上架/下架）
    boolean updateCourseStatus(Long courseId, Integer status);

    // 上传课程图片
    String uploadCourseImage(MultipartFile file) throws Exception;

    // 在CourseService接口中添加方法
    CourseReservationDTO getCourseReservationInfo(Long courseId);

    String getCourseGrade(Long courseId);
}